#pragma once

#include "Serializable.h"
#include "Vectors.h"

class Team;
class ServiceProvider;
class People;

struct Bet
{
#ifndef DARIO
	explicit Bet(Team* i_team = 0, People* i_player = 0, unsigned int i_salary = 0, unsigned int i_years = 0)
		:m_team(i_team)
		,m_player(i_player)
		,m_salary(i_salary)
		,m_years(i_years)
	{
	}
	unsigned int	m_salary;
	unsigned int	m_years;
#else
	explicit Bet(Team* i_team = 0, People* i_player = 0, unsigned int i_bid = 0)
		:m_team(i_team)
		,m_player(i_player)
		,m_bid(i_bid)
	{
	}
	unsigned int	m_bid;
#endif
	Team*			m_team;
	People*			m_player;

};
typedef STL::vector<Bet> BetVec;
typedef BetVec::iterator BetVecIt;
typedef BetVec::const_iterator BetVecCIt;


class AuctionManager : public Serializable
{
	friend class GameManager;

public:
	bool AddBet(const Bet& i_bet);
	void Dispatch(const bool i_doNotPrompt);
	void Clear();

	virtual	ZStream&	Serialize(ZStream& o_stream) const;
	virtual ZStream&	Deserialize(ZStream& i_stream);
	
private:
	//copy disabled
	AuctionManager(const AuctionManager&);
	AuctionManager& operator=(const AuctionManager&);

	explicit AuctionManager(ServiceProvider* i_sp);

	ServiceProvider* m_sp;
	BetVec m_bets;
};

